package com.yt.bigdata;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

import java.io.Serializable;

@Data
class Parigrammer implements Serializable {
    private String name;
    private Integer age;
}

@Data
public class ResultVO<T> {
    private String msg;
    private T data;


    public static void main(String[] args) {
        StringBuilder result = new StringBuilder();
        String s = "{\"data\":{\"name\":\"leiss\",\"age\":\"1024\"},\"msg\":\"我是程序员\"}";
        ResultVO resultVO = JSONObject.parseObject(s, ResultVO.class);
        // Prog data1 = (Prog) resultVO.getData();
        Parigrammer parigrammer = JSONObject.parseObject(JSONObject.toJSONString(resultVO.getData()), Parigrammer.class);

        result.append(resultVO.getMsg()).append(parigrammer.getName()).append(parigrammer.getAge()).append("了还能写代码？");
        System.out.println(result.toString());
    }
}
